<template>
    <el-card class="box-card">
        <div class="Top">
            <div class="icon">
                <el-icon>
                    <iconView />
                </el-icon>
            </div>
            <div class="HeaderTop">
                <slot></slot>
            </div>
        </div>
        <el-divider border-style="double" style="margin: 8px 0 8px 0;" />
        <div class="button">
            <div class="Title">{{ title }}</div>
            <slot name="button"></slot>
        </div>
    </el-card>
</template>
<script setup>
import { h } from 'vue';
const props = defineProps(['title', 'icon']);
const iconView = h(props.icon);

</script>
<style lang="less" scoped>
:deep(.el-card__body) {
    padding: 12px;
}

.Top {
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

.icon {
    flex: 32px 0 0;
    margin: 0 8px 0 0;
    width: 32px;
    height: 32px;
    font-size: 22px;
    text-align: center;
    line-height: 32px;
}

.HeaderTop {
    width: 100%;
}

.button {
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}
</style>